<?php


namespace app\sys\model;


use think\Db;
use think\Model;

class QyeDepartment extends Model
{
    protected $autoWriteTimestamp = true;

    public static function add($data)
    {
        Db::name("qye_department")->delete(true);
        foreach ($data as $k => $v){
            QyeDepartment::create(["id"=>$v->id,"name"=>$v->name,"parentid"=>$v->parentid,"order"=>$v->order]);
        }
    }
}